<?php /*a:2:{s:56:"E:\source\EasyPeak\application\admin\view\form\form.html";i:1575771817;s:75:"E:\source\EasyPeak\application\admin\view\..\..\common\view\admin_base.html";i:1572404708;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>编辑后台</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href=" /static/fontawesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/admin/admin.css" media="all">
    <script src="/static/js/jquery.min.js"></script>
</head>
<body>
<script src="/static/layui/layui.js"></script>
<script>
    layui.use(['form'],function(){
        var form = layui.form;
        form.on('submit(reset)',function(){
            location.reload();
        })
    })
</script>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-form">
                        <div class="layui-form-item layui-hide">
                            <label class="layui-form-label">guid</label>
                            <div class="layui-input-inline" style="width:260px;">
                                <input type="text" name="form[guid]" value="<?php echo htmlentities((isset($model['guid']) && ($model['guid'] !== '')?$model['guid']:'')); ?>" autocomplete="off" placeholder="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">模块名称</label>
                            <div class="layui-input-inline" style="width:200px;">
                                <input type="text" name="form[module]" value="<?php echo htmlentities((isset($model['module']) && ($model['module'] !== '')?$model['module']:'')); ?>" autocomplete="off" placeholder="模块名称" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">标题</label>
                            <div class="layui-input-inline" style="width:260px;">
                                <input type="text" name="form[name]" value="<?php echo htmlentities((isset($model['name']) && ($model['name'] !== '')?$model['name']:'')); ?>" autocomplete="off" placeholder="侧边栏显示的标题" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">图标</label>
                            <div class="layui-input-inline" style="width:240px;">
                                <input type="text" id="icon" name="form[icon]" value="<?php echo htmlentities((isset($model['icon']) && ($model['icon'] !== '')?$model['icon']:'')); ?>" autocomplete="off" placeholder="侧边栏显示的图标" class="layui-input">
                            </div>
                            <div class="layui-input-inline">
                                <div class="layui-btn" id="iconselected" url="<?php echo url('admin/publics/selecticon'); ?>">选择按钮</div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">摘要</label>
                            <div class="layui-input-block" style="width:360px;">
                                <textarea class="layui-textarea" name="form[remark]" lay-verify="content" ><?php echo htmlentities((isset($model['remark']) && ($model['remark'] !== '')?$model['remark']:'')); ?></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">主表</label>
                            <div class="layui-input-inline" style="width:180px;">
                                <input type="text" name="form[maintable]" value="<?php echo htmlentities((isset($model['maintable']) && ($model['maintable'] !== '')?$model['maintable']:'')); ?>" autocomplete="off" placeholder="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">附表</label>
                            <div class="layui-input-inline" style="width:180px;">
                                <input type="text" name="form[extratable]" value="<?php echo htmlentities((isset($model['extratable']) && ($model['extratable'] !== '')?$model['extratable']:'')); ?>" autocomplete="off" placeholder="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">序号</label>
                            <div class="layui-input-inline" style="width:80px;">
                                <input type="text" name="form[sort]" value="<?php echo htmlentities((isset($model['sort']) && ($model['sort'] !== '')?$model['sort']:'50')); ?>" autocomplete="off" placeholder="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="commit">提交</button>
                                <button class="layui-btn layui-btn-primary" lay-submit lay-filter="reset">重置</button>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    layui.use(['element','layer', 'table','form'], function() {
        var element = layui.element;
        var layer = layui.layer;
        var form = layui.form;

        form.on('submit(commit)', function(obj){
            $.post({
                url:document.URL
                ,type:'post'
                ,data: obj.field
                ,success:function(res){
                    if(res.code == 1){
                        layer.msg(res.msg, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        }, function(){
                            top.window.document.location.reload();
                        });
                    }else{
                        layer.msg(res.msg);
                    }
                }
            });
        });

        $("#iconselected").click(function(){
            var url = $(this).attr('url');
            top.layer.open({
                type: 2,
                title: '图标列表',
                shade: 0,
                area: ['780px', '560px'],
                content: url,
                success: function(layero,index){
                    var winname = layero.find('iframe')[0]['name'];
                    top.$("#"+winname).contents().find('.icon-item').on('click',function(){
                        var classname = $(this).find('i').prop('className');
                        $("#icon").val(classname);
                        top.layer.close(index);
                    });
                }
            });
        })
    });

</script>


</body>
</html>